/**
 * Created by Administrator on 2017/3/27 0027.
 */
var ThreeAssetsManager={
    Create:function(){
        var assetsManager={};


        var manager=new THREE.LoadingManager();
        manager.onStart = function ( url, itemsLoaded, itemsTotal ) {
            // console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
        };
        manager.onProgress=function(url,itemsLoader,itemsTotal){
            document.dispatchEvent(new CustomEvent("Three_Loading",{detail:itemsLoader/itemsTotal*100}))
            if(itemsLoader==itemsTotal){
                // document.dispatchEvent(new CustomEvent("HajimeCompleted",{detail:arr_texture}));
                document.dispatchEvent(new CustomEvent("ThreeLoaded",{detail:1}));
            }
        };

        //*******************
        //*******************
        //*******************
        var TL=new THREE.TextureLoader(manager);
        // var arr_texture=[];
        // for(var z=1;z<=6;z++) {
        //     arr_texture.push(TL.load("images/head1_" + z + ".png"));
        // }
        // for(var z=1;z<=6;z++) {
        //     arr_texture.push(TL.load("images/head2_" + z + ".png"));
        // }
        // for(var z=1;z<=9;z++) {
        //     arr_texture.push(TL.load("images/head3_" + z + ".png"));
        // }
        // for(var z=1;z<=4;z++) {
        //     arr_texture.push(TL.load("images/head4_" + z + ".png"));
        // }
        // for(var z=1;z<=5;z++) {
        //     arr_texture.push(TL.load("images/head5_" + z + ".png"));
        // }
        // for(var z=1;z<=6;z++) {
        //     arr_texture.push(TL.load("images/head6_" + z + ".png"));
        // }
        // tip_textrue=TL.load("images/hand.png");
        // longpicMap=TL.load("images/longPic.png");

        assetsManager.resource={};
        assetsManager.resource.image1=TL.load("assets/images/1.png");
        assetsManager.resource.image2=TL.load("assets/images/2.png");
        assetsManager.resource.image3=TL.load("assets/images/3.png");


        return assetsManager;
    }
}